[pull] master from ruby:master - #1371
Merged
Merged
Conversation
Use the profiled splat array length to expand caller splats into fixed positional arguments for SendDirect. Guard the runtime length and fall back to the original Send when it changes or ruby2_keywords semantics apply. Validate direct sends using the expanded argument count, then apply the existing keyword setup and rest parameter packing. Move the ruby2_keywords splat predicate into shared JIT code so both YJIT and ZJIT can use it.
Caller-splat dispatch creates a join result during type_specialize. A following CFunc inline may use it before infer_types runs again, causing ZJIT to infer the type of an untyped Param and panic. Mark the join result as BasicObject and add regression tests for using it with Hash#[]=.
Move receiver guards, argument emission, and SendDirect generation into a callback invoked by dispatch_caller_splat. This keeps caller-splat CFG construction together and allows adding one optimized path per profiled length for polymorphic dispatch.
Use guards instead of a dynamic Send fallback and join block for monomorphic caller splats. Recompile on length mismatches so the call site can collect a new profile, and side-exit without recompiling for ruby2_keywords hashes. Skip caller-splat specialization for final no-side-exit ISEQ versions.
Document that observing a second splat length makes the profile non-monomorphic, so the next version keeps the dynamic Send instead of emitting the same length guard. Add an opt test that verifies this before the final-version policy applies.
Select the profiled caller-splat length in add_iseq_to_hir and attach it to each Send before receiver dispatch creates its specialized arms. type_specialize then uses the selected length to build each SendDirect path. This prepares caller-splat dispatch for supporting multiple profiled lengths without making type_specialize responsible for building the outer dispatch CFG.
We are out of imemo types because IMEMO_MASK uses 4 bits and we have 16 imemo types. This makes it not possible to experiment with new imemo types, so we can increase it by one bit to have 16 more imemo types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )